package cn.kgc.mushroomcommon.api;

import cn.kgc.mushroomcommon.pojo.*;

import cn.kgc.mushroomcommon.util.CrowdConstant;
import cn.kgc.mushroomcommon.util.CrowdUtils;
import cn.kgc.mushroomcommon.vo.ShopVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@FeignClient("MUSHROOM-DATABASE-PROVIDER")
public interface DataBaseOperationRemoteService {


    @RequestMapping("/database/provider/commodity/selectCommodityAndDetail")
    public Commodity selectCommodityAndDetail(@RequestParam("id") Integer id) ;

    @RequestMapping("/commodity/selectcomm")
    public List<Commodity> selectcomm();

    @RequestMapping("/commodity/selectTop")
    public List<Commodity> selectTop();


    @RequestMapping("/commodity/selectByid")
    public List<Commodity> selectByid(@RequestParam("tidcommtype")Integer tidcommtype);

    @RequestMapping("/commodity/select/commodity/by/commOrtypename")
    public List<Commodity> selectCommodityByTitleOrTypeName(@RequestParam("commOrTypeName")String commOrTypeName,
                                                            @RequestParam("tiaojian")Integer tiaojian,
                                                            @RequestParam("smallMoney")String smallMoney,
                                                            @RequestParam("bigMoney")String bigMoney);


    @RequestMapping("/database/provider/shoppingcar/query/shoppingcar/list")
    public List<Shoppingcar> selectShoppingCarList();


    @RequestMapping("/database/provider/shoppingcar/batch/remove")
    public Integer batchRemove(@RequestBody List<Integer> shoppingCarIdList) ;

    @RequestMapping("/database/provider/shoppingcar/query/shoppingcar/list/by/id/list")
    public List<Shoppingcar> getShoppingCarListByIdList(@RequestBody List<Integer> shoppingCarIdList);

    @RequestMapping("/type/selectType")
    public List<Type> selectType();


    @RequestMapping("/database/provider/user/retrieve/user/by/login/acct")
    public ResultEntity<User> retrieveMemberByLoginAcct(@RequestParam("account") String account) ;

    @RequestMapping("/database/provider/user/register")
    public ResultEntity<String> register(@RequestBody User user) ;

    @RequestMapping("/database/provider/user/retrieve/loign/acct/count")
    public ResultEntity<Integer> retrieveAccountCount(
            @RequestParam("account") String account) ;

    @RequestMapping("/database/provider/user/retrieve/loign/phone/count")
    public ResultEntity<Integer> getPhoneCount(
            @RequestParam("phone") String phone) ;

    @RequestMapping("/shop/provider/selectall")
    public List<Shop> selectall();

    @RequestMapping("/type/selectshoptype")
    public List<Type> selectshoptype(@RequestParam("sid")Integer sid);

    @RequestMapping("/shop/provider/selectByid")
    public Shop selectById(@RequestParam("id")Integer id);

    @RequestMapping("/database/provider/commodity/selectshopallname")
    public List<Commodity> selectshopallname(@RequestParam("tid")Integer tid);
    @RequestMapping("/shop/provider/selectShopComId")
    public Shop selectShopComId(@RequestParam("id")Integer id);

    @RequestMapping("/shop/provider/insertshopanduser")
    public Map<String,Object> insertshopanduser(@RequestParam("shopcollid")Integer shopcollid, @RequestParam("userid")Integer userid);

    @RequestMapping("/order/selectOrderAndComm")
    public List<Order> selectOrderAndComm(@RequestParam("ordenum")String ordenum);


    @RequestMapping("/order/deleteOrder")
    public Map<String,Object> deleteOrder(@RequestParam("id")Integer id);

    @RequestMapping("/database/provider/address/query/address/view/list/by/uid")
    public List<Address> selectAddressListByView(@RequestParam(value = "uidaddress",defaultValue = "0") Integer uidaddress);

    @RequestMapping("/order/insertOrder")
    public Integer insertOrder(@RequestBody Order order);

    @RequestMapping("/database/provider/address/insertaddress")
    public Map<String,Object> insertaddress(@RequestBody Address address);

    @RequestMapping("/database/provider/address/deleteaddress")
    public Map<String,Object> deleteaddress(@RequestParam("id")Integer id);

    @RequestMapping("/database/provider/address/updateaddress")
    public Map<String,Object> updateaddress(@RequestParam("id")Integer id);

    @RequestMapping("/database/provider/address/selectByStatus")
    public Address selectByStatus(@RequestParam("status")Integer status);

    @RequestMapping("/database/provider/address/updatemoren")
    public Map<String,Object> updatemoren(@RequestParam("id")Integer id);

    @RequestMapping("/shop/provider/selectColl")
    public List<Coll> selectColl(@RequestParam("userid")Integer userid);
    @RequestMapping("/database/provider/user/getUserByPhone")
    public ResultEntity<User> getUserByPhone(@RequestParam("phone") String phone);

    @RequestMapping("/common/selectCommon")
    public List<Common> selectCommon(@RequestParam("id")Integer id);

    @RequestMapping("/database/provider/shoppingcar/addShopCar")
    public ResultEntity<String> addShopCar(@RequestBody Shoppingcar shoppingcar);

    @RequestMapping("/shop/provider/selectshopbyname")
    public List<ShopVO> selectshopByName(@RequestParam("shopName")String shopName);
}
